<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
       @keyframes box {
        from {
          transform: translateX(0px);
        }
        66.66% {
          transform: translateX(-300px);
        }
        to {
          transform: translateX(-600px);
        }
      }
        *{
            margin: 0;
            padding: 0;
            list-style: none;
            text-decoration: none;
        }
        .box{
            width: 300px;
            height: 150px;
            margin: 0 auto;
            
            border: 1px solid #000;
             overflow: hidden;
            
        }
            ul{
            display: flex;
            width: 900px;
            height: 150px;
            line-height: 150px;
            font-size: 30px;
            animation: box 3s ease 0s infinite alternate;
            
        }
            ul li {
            flex: 1;
            text-align: center;
        }
        .box .RED{
            /* width: 300px;
            height: 150px; */
            background-color: red;
            
        }
        .box .GREEN{
            /* width:  300px;
            height: 150px; */
            background-color: green;
           
           
           
            
        }
        .box .BLUE{
            /* width:  300px;
            height: 150px; */
            background-color: blue;
           
            
        }

    </style>
</head>
<body>
    <div class="box">
        <!-- <div class="RED">RED</div>
        <div class="GREEN">GREEN</div>
        <div class="BLUE">BLUE</div> -->
        <ul>
            <li class="RED">RED</li>
            <li class="GREEN">GREEN</li>
            <li class="BLUE">BLUE</li>
        </ul>
    </div>
    
</body>
</html>